home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 751-760 / 757 / pc / pc.s < prev    next >
Text File  |  1995-03-18  |  32KB  |  1,547 lines

  1. ; Printer Controller (PC). Written By  Kamran Karimi
  2. ;Sends ESCAPE codes to printer according to ANSI X3.64 Standard
  3. ; Compiled With Profimat Assembler From 'DATA BECKER' 
  4. ;On an Amiga 500 with OS1.3 
  5.  
  6.  
  7. ROM_ROUTINE_ADDRESSES:
  8. ExecBase       equ  4
  9. Open           equ -30
  10. Close          equ -36
  11. Read           equ -42
  12. Write          equ -48
  13. OpenLib        equ -408
  14. CloseLib       equ -414
  15. GetMsg         equ -372
  16. OpenWindow     equ -204
  17. CloseWindow    equ -72
  18. AutoRequest    equ -348
  19. SetMenuStrip   equ -264
  20. ClearMenuStrip equ -54
  21. DisplayBeep    equ -96
  22. PrintIText     equ -216
  23. DrawBorder     equ -108
  24. WaitPort       equ -384
  25. FindTask       equ -294
  26. ReplyMsg       equ -378
  27.  
  28. CLI_WB:             ;from WB or CLI?
  29.  move.l ExecBase,a6
  30.  move.l #0,a1
  31.  jsr    FindTask(a6)
  32.  move.l d0,a2
  33.  tst.l  $ac(a2)
  34.  bne    OPENING_NECESSARY_STUFF   ;from CLI!
  35.  lea    $5c(a2),a0
  36.  jsr    WaitPort(a6)
  37.  lea    $5c(a2),a0
  38.  jsr    GetMsg(a6)   ;get the WB message but we don't need it
  39.  
  40. OPENING_NECESSARY_STUFF:
  41. Open_Intuition:
  42.  move.l #20,DOSResult
  43.  move.l ExecBase,a6
  44.  lea    Intuition_Name,a1
  45.  moveq  #0,d0              ;any version
  46.  jsr    OpenLib(a6)
  47.  move.l d0,Intuition_Base   ;we (hopefully) opened intuition.library
  48.  beq    Close_Intuition
  49. Open_DOS:
  50.  lea    DOS_Name,a1
  51.  moveq  #0,d0
  52.  jsr    OpenLib(a6)
  53.  move.l d0,DOS_Base
  54.  beq    Close_DOS      ;we (hopefully) opened the dos.library
  55.  bra    FirstStart   ;we open the small window at the begining
  56.  
  57. Window_Opening:
  58.  move.l Intuition_Base,a6
  59.  lea    Window_Parameters,a0    ;window specifications
  60.  jsr    OpenWindow(a6)
  61.  move.l d0,Window_Handler
  62.  beq    Close_DOS
  63.  lea    Border1,a1  ;the border arount message box and start,end columns
  64.  move.l #190,d0     ;absolute X pos.
  65.  move.l #65,d1      ;absolute Y pos.
  66.  move.l Intuition_Base,a6
  67.  move.l Window_Handler,a0
  68.  move.l 50(a0),a0        ;window rastport
  69.  jsr    DrawBorder(a6)
  70. Set_Menu:
  71.  jsr    SetM
  72.  lea    Intro,a1   ;write 'By Kamran Karimi'
  73.  jsr    Prompting
  74.  lea    Stext,a1   ;write 'Start Column'
  75.  move.l #145,d0    ;X pos.
  76.  move.l #45,d1     ;Y pos.
  77.  jsr    SI         ;write
  78.  lea    Etext,a1   ;write 'End Column'
  79.  move.l #280,d0
  80.  move.l #45,d1
  81.  jsr    SI
  82.  lea    UnKnown,a1  ;write '???'
  83.  move.l #180,d0
  84.  move.l #56,d1
  85.  jsr    SI
  86.  lea    UnKnown,a1
  87.  move.l #305,d0
  88.  move.l #56,d1
  89.  jsr    SI
  90.  jsr    Find_Event     ;find intuition event
  91.  lea    Menu_Bars,a1
  92.  jsr    Prompting     ;change prompt in message box
  93.  bra    START
  94.  
  95. loop:
  96.  jsr    SetM
  97. FEvent:
  98.  jsr    Reply
  99.  jsr    Find_Event
  100. START:
  101.  jsr    UpDate         ;update start and end columns
  102.  move.l Event,a0
  103.  move.l $14(a0),d6
  104.  cmp    #$200,d6        ;window_close selected?
  105.  beq    End_Requested
  106.  cmp    #$100,d6        ;menu chosen?
  107.  beq    Chosen
  108.  bra    FEvent           ;no important event .loop on
  109. chosen:
  110.  move   $18(a0),d7
  111.  jsr    CLRMenu     ;wipe menu structure because we may have to change it!
  112.  cmp    #$FFFF,d7    ;only right button pressed?
  113.  beq    loop
  114. Real_Selection:
  115.  move   d7,d6
  116.  andi   #$1f,d6      ;d6 has the menu column number
  117.  cmp    #$0,d6
  118.  beq    Style_Column
  119.  cmp    #$1,d6
  120.  beq    Character_Column
  121.  cmp    #$2,d6
  122.  beq    Control_Column
  123.  cmp    #$3,d6
  124.  beq    Print_Column
  125.  bra    StandBy_COLUMN   ;if it was not the other columns it must be this!
  126.  
  127. Style_Column:
  128.  move   d7,d6
  129.  lsr    #5,d6      ;we want the menu item number
  130.  andi   #$3f,d6       ;and only that!
  131.  move   d6,d5
  132.  move   #0,charset 
  133.  lea    menu11,a1
  134.  mulu   #34,d6
  135.  add    #32,d6  ;obtain the next selected menu at the end of menu structure
  136.  adda.l d6,a1
  137.  cmp    #$FFFF,(a1)    ;anything else chosen?
  138.  beq    NoSels
  139.  move   (a1),NextM     ;The next menu chosen while holding down the mouse
  140.  move   #1,NextMSel   ;flag to show that we must process the next menu
  141. NoSels:
  142.  move   d5,d6
  143.  mulu   #12,d5         ;every item has 6 chars for ON and 6 for OFF (6+6=12)
  144.  move   COLUMN1_FLAGS,d4 ;flags to remember the merked menu options
  145.  cmp    #8,d6             ;was it superscript?
  146.  bne    nosup
  147.  bclr   #9,d4        ;then demark the subscript flag
  148. nosup:
  149.  cmp    #9,d6        ;was it subscript?
  150.  bne    nosub
  151.  bclr   #8,d4        ;then demark the superscript flag
  152. nosub:
  153.  move.l #Styles,a5      ;get the start of the style code table
  154.  bchg   d6,d4            ;change the flag.0 for unmarked, 1 for marked
  155.  bne    reverse1          ;if it was 0 send the ON code else the OFF code
  156.  move   d4,COLUMN1_FLAGS  ;save the flags
  157.  adda.l  d5,a5            ;get the address of the code
  158.  bra     print         ;print the ON code
  159. reverse1:
  160.  move   d4,COLUMN1_FLAGS
  161.  adda.l d5,a5
  162.  adda.l #6,a5    ;the OFF code is 6 chars after the ON
  163.  bra    print    ;print the OFF code
  164.  
  165. Character_Column:
  166.  move   d7,d6
  167.  lsr    #5,d6
  168.  andi   #$3f,d6
  169.  move   #1,flag
  170.  move   #1,charset   ;charset shows that char.set has been chosen
  171.  move   d6,d5
  172.  lea    menu21,a1
  173.  mulu   #34,d6
  174.  add    #32,d6
  175.  adda.l d6,a1
  176.  cmp    #$FFFF,(a1)
  177.  beq    NoSelc
  178.  move   (a1),d6
  179.  andi   #$1f,d6      ;d6 has the menu column number
  180.  cmp    #$1,d6       ;the other chosen menu was in another column?
  181.  bne    SomeOtherM     ;yes!
  182.  move   (a1),d7
  183.  bra    Character_Column    ;send only the last char set chosen!
  184. SomeOtherM:
  185.  move   (a1),NextM     ;The next menu chosen while holding down the mouse
  186.  move   #1,NextMSel
  187. NoSelc:
  188.  move   d5,d6
  189.  mulu   #6,d5            ;every option has 6 chars (no OFF code)
  190.  move.l #Characters,a5   ;get the code table start address
  191.  adda.l d5,a5
  192.  move.l #menu21,a4     ;start of menu staructures
  193.  move   d6,d4
  194.  mulu   #34,d4        ;the structures length is 34 Bytes
  195.  add    #12,d4        ;the requiered Byte is the 12th
  196.  adda.l d4,a4
  197.  bset   #8,(a4)             ;set the CHECKED bit
  198.  bra    print             ;send the code for the character set
  199.  
  200. Control_Column:
  201.  move   #0,charset
  202.  move   d7,d6
  203.  lsr    #5,d6
  204.  andi   #$3f,d6
  205.  move   d6,d5
  206.  lea    menu31,a1
  207.  mulu   #34,d6
  208.  add    #32,d6
  209.  adda.l d6,a1
  210.  cmp    #$FFFF,(a1)
  211.  beq    NoSelcon
  212.  move   (a1),NextM     ;The next menu chosen while holding down the mouse
  213.  move   #1,NextMSel
  214. NoSelcon:
  215.  move   d5,d6
  216.  cmp    #6,d5      ;Reset was chosen?
  217.  beq    MReset      ;yes then clear checked menu items
  218.  cmp    #5,d5       ;Initilise chosen?
  219.  beq    MInitialize   ;yes then clear some menu items
  220. GoOn:
  221.  mulu   #12,d5
  222.  move   COLUMN3_FLAGS,d4
  223.  move.l #Controls,a5
  224.  bchg   d6,d4
  225.  bne    reverse3
  226.  move   d4,COLUMN3_FLAGS
  227.  adda.l d5,a5
  228.  bra    print
  229. reverse3:
  230.  move   d4,COLUMN3_FLAGS
  231.  adda.l d5,a5
  232.  adda.l #6,a5
  233.  bra    print
  234.  
  235. Print_Column:
  236.  move   d7,d6
  237.  lsr    #5,d6
  238.  andi   #$3f,d6
  239.  cmp    #1,d6
  240.  beq    LINE
  241. FILE:
  242.  lea    FPROMPT,a1    ;write 'Enter File...'
  243.  jsr    Prompting
  244. A_FILE:
  245.  jsr    Find_Event
  246.  jsr    UpDate
  247.  move.l Event,a0
  248.  move.l $14(a0),d6
  249.  cmp    #$40,d6         ;gadget was chosen?
  250.  bne    A_FILE
  251.  move.l $1c(a0),d6
  252.  jsr    Reply
  253.  move.l Event2,Event
  254.  cmp.l  #GADOK,d6
  255.  beq    Process_File_Print
  256.  cmp.l  #GADNO,d6
  257.  beq    ClearP             ;NO selected.clear the prompt and goto loop
  258.  bra    A_FILE
  259. LINE:
  260.  lea    LPROMPT,a1      ;write 'Enter Line:'
  261.  jsr    Prompting
  262. A_LINE:
  263.  jsr    Find_Event
  264.  jsr    UpDate
  265.  move.l Event,a0
  266.  move.l $14(a0),d6
  267.  cmp    #$40,d6      ;a gadget was chosen?
  268.  bne    A_LINE
  269.  move.l $1c(a0),d6
  270.  jsr    Reply
  271.  move.l Event2,Event
  272.  cmp.l  #GADOK,d6     ;was it OK?
  273.  beq    OKSELECT
  274.  cmp.l  #GADNO,d6    ;or maybe NO?
  275.  beq    ClearP
  276.  bra    A_LINE
  277. OKSELECT:
  278.  lea    Busy,a1      ;write 'Please Wait...'
  279.  jsr    Prompting
  280.  tst    Number        ;is there any input?
  281.  beq    Clearp
  282.  clr.l  d3
  283.  move   Number,d3     ;Number is the number of chars in gadget
  284.  lea    Buffer,a3     ;start of chars in gadget
  285.  adda.l d3,a3        ;get the end of buffer
  286.  move.b #10,(a3)+       ;add Line Feed
  287.  move.b #13,(a3)           ;and FormFeed
  288.  move   COLUMN1_FLAGS,d5
  289.  btst   #1,d5             ;Underline is ON?
  290.  beq    No_Space ;no,otherwise we should first turn it off,print the leading
  291.           ; spaces,turn the underline on,and print the non-space characters
  292.  tst.l  Spaces      ;is there spaces at the begining of the text in gadget?
  293.  beq    No_Space    ;no,so no need to send underline off code to the printer
  294.  jsr    OpenPrinter
  295.  move.l d0,PRT_Handler
  296.  bne    OKSEL
  297.  lea    Menu_Bars,a1   ;printer didn't open!
  298.  jsr    Prompting
  299.  move   #1,d0
  300.  bra    PRT_FAILED
  301. OKSEL:
  302.  lea    Styles,a5
  303.  adda.l #18,a5
  304.  move   #1,UnderFlag
  305.  jsr    Prin            ;turn the UnderLine OFF
  306.  jsr    OpenPrinter
  307.  move.l d0,PRT_Handler
  308.  bne    Open1
  309.  lea    Menu_Bars,a1
  310.  jsr    Prompting
  311.  move   #0,UnderFlag
  312.  move   #1,d0
  313.  bra    PRT_FAILED
  314. open1:
  315.  move.l PRT_Handler,d1
  316.  move.l DOS_Base,a6
  317.  move.l #SPC,d2
  318.  move.l Spaces,d3
  319.  jsr    Write(a6)       ;write spaces
  320.  jsr    ClosePrinter
  321.  jsr    OpenPrinter
  322.  move.l d0,PRT_Handler
  323.  bne    Open2
  324.  lea    Menu_Bars,a1
  325.  jsr    Prompting
  326.  move   #0,UnderFlag
  327.  move   #1,d0
  328.  bra    PRT_FAILED
  329.  
  330. Open2:
  331.  move.l #Styles,a5
  332.  add.l  #12,a5
  333.  jsr    Prin           ;turn the UnderLine ON
  334.  move   #0,UnderFlag
  335.  move.l #buffer,d4     ;get the buffer address
  336.  add.l  Spaces,d4      ;advance it so tahat spaces won't print
  337.  move   Number,d3
  338.  sub.l  Spaces,d3     ;sub number of spaces from the total number of chars
  339.  bra    Skip         ;jump the following line so that parameters won't change
  340. No_Space:
  341.  move   Number,d3     ;print the whole buffer
  342.  move.l #Buffer,d4
  343. Skip:
  344.  add.l  #1,d3
  345.  jsr    OpenPrinter
  346.  move.l d0,PRT_Handler
  347.  bne    Open3
  348.  lea    Menu_Bars,a1
  349.  jsr    Prompting
  350.  move   #0,UnderFlag
  351.  move   #1,d0
  352.  bra    PRT_FAILED
  353. Open3:
  354.  move.l PRT_Handler,d1
  355.  move.l DOS_Base,a6
  356.  move.l d4,d2
  357.  jsr    Write(a6)      ;write line
  358.  jsr    ClosePrinter
  359.  bra    LINE
  360.  
  361. StandBy_Column: ;closes the window and opens a small one waiting for a click
  362. Close_Window:
  363.  move.l Intuition_Base,a6
  364.  move.l Window_Handler,a0
  365.  jsr    CloseWindow(a6)
  366. FirstStart:                   ;here is where we jump at the begining
  367. Window_Openung2:
  368.  move.l Intuition_Base,a6
  369.  lea    Small_Window_Parameters,a0
  370.  jsr    OpenWindow(a6)
  371.  move.l d0,Small_Window_Handler
  372.  beq    Close_DOS
  373.  move.l ExecBase,a6
  374.  move.l Small_Window_Handler,a0
  375.  move.l 86(a0),a0
  376.  jsr    WaitPort(a6)    ;wait!
  377.  move.l ExecBase,a6
  378.  move.l Small_Window_Handler,a0
  379.  move.l 86(a0),a0
  380.  jsr    GetMsg(a6)
  381.  move.l d0,a1
  382.  jsr    ReplyMsg(a6)
  383.  
  384. WindowClosing:                ;we got the click!. close the window
  385.  move.l #0,Buffer
  386.  move.l Intuition_Base,a6
  387.  move.l Small_Window_Handler,a0
  388.  jsr    CloseWindow(a6)
  389.  bra    Window_Opening
  390.  
  391. Process_File_Print:
  392.  lea    Busy,a1
  393.  jsr    Prompting
  394.  tst    Number
  395.  beq    Clearp
  396.  jsr    OpenPrinter
  397.  move.l d0,PRT_Handler
  398.  bne    proc
  399.  lea    Menu_bars,a1          ;Could NOT Open Printer!
  400.  jsr    Prompting
  401.  move   #1,d0
  402.  bra    PRT_FAILED
  403. proc:
  404.  move.l DOS_Base,a6    ;opening  requested file
  405.  move.l #Buffer,d1    ;buffer holds the file's name
  406.  move.l #1005,d2
  407.  jsr    Open(a6)
  408.  move.l d0,FileHd
  409.  bne    Reading
  410.  lea    Menu_bars,a1   ;could not open file!
  411.  jsr    Prompting
  412.  bra    No_File
  413. Reading:
  414.  move.l DOS_Base,a6
  415.  move.l FileHd,d1
  416.  move.l #512,d3         ;read 512 Bytes at a time
  417.  move.l #ReadBuffer,d2
  418.  jsr    Read(a6)
  419.  cmp    #0,d0              ;any thing read?
  420.  beq    Exit_File_Print   ;no then exit
  421.  move.l DOS_Base,a6
  422.  move.l PRT_Handler,d1    ;write
  423.  move.l #ReadBuffer,d2
  424.  move.l d0,d3
  425.  jsr    Write(a6)
  426.  bra    Reading
  427. Exit_File_Print:
  428.  move.l FileHd,d1
  429.  move.l DOS_Base,a6
  430.  jsr    Close(a6)
  431.  jsr    ClosePrinter
  432.  bra    clearp
  433.  
  434. Print:                  ;send code to printer
  435.  lea    Busy,a1      ;write 'Please Wait...'
  436.  jsr    Prompting
  437.  jsr    OpenPrinter
  438.  move.l d0,PRT_Handler
  439.  bne    Prn
  440.  tst    charset         ;charset has been chosen?
  441.  beq    not_C2
  442.  move   #0,flag
  443. not_C2:
  444.  lea    Menu_bars,a1
  445.  jsr    Prompting
  446.  move   #0,d0
  447.  bra    PRT_FAILED
  448. Prn:
  449.  tst    charset
  450.  beq    Prin
  451.  move   d6,last  ;save the last character set, in case we could not send a 
  452.                    ;new character code we must restore it with the old one
  453. Prin:
  454.  move.l PRT_Handler,d1
  455.  move.l DOS_Base,a6
  456.  move.l a5,d2
  457.  move.l #6,d3        ;write 6 chars
  458.  jsr    Write(a6)
  459.  jsr    ClosePrinter
  460.  move   UnderFlag,d1    ;entered to turn the UnderLine code ON or OFF?
  461.  beq    ProcessNext
  462.  rts             ;yes.we called prin with jsr so:RTS!
  463.  
  464. ClearP:
  465.  lea    Menu_bars,a1
  466.  jsr    Prompting
  467.  bra    loop
  468.  
  469. No_Menu_Allowed: ;this routine restores menu checkmarks to their original
  470.            ; state when the chosen codes could not be sent to the  printer
  471.  tst    d0
  472.  beq    No_M
  473.  rts
  474. No_M:
  475.  move   d7,d6
  476.  andi.l #$1f,d6
  477.  cmp    #$0,d6
  478.  beq    C1
  479.  cmp    #$1,d6
  480.  beq    C2
  481.  cmp    #$2,d6
  482.  beq    C3
  483.  rts     ;columns 4 print and stand by don't need changes
  484. C1:
  485.  move   d7,d6
  486.  lsr    #5,d6
  487.  andi.l #$3f,d6
  488.  mulu   #34,d6       ;menu structures are 34 Bytes
  489.  lea    menu11,a0     ;menu structure address
  490.  adda.l d6,a0
  491.  adda.l #12,a0
  492.  bchg   #8,(a0)     ;change the CHECKED bit (if ON then OFF,if OFF then ON)
  493.  rts        ;restore menu with new data
  494. C2:
  495.  move   d7,d6
  496.  lsr    #5,d6
  497.  andi.l #$3f,d6
  498.  mulu   #34,d6
  499.  lea    menu21,a0
  500.  adda.l d6,a0
  501.  adda.l #12,a0
  502.  bclr   #8,(a0)
  503.  tst    flag        ;have we ever entered the character set column?
  504.  bne    changed
  505.  rts
  506. changed:           ;yes!
  507.  move   last,d6
  508.  mulu   #34,d6
  509.  lea    menu21,a0
  510.  adda.l d6,a0
  511.  adda.l #12,a0
  512.  bset   #8,(a0)
  513.  rts
  514. C3:
  515.  move   d7,d6
  516.  lsr    #5,d6
  517.  andi   #$3f,d6
  518.  mulu   #34,d6
  519.  lea    menu31,a0
  520.  adda.l d6,a0
  521.  adda.l #12,a0
  522.  bchg   #8,(a0)
  523.  rts
  524.  
  525. SetM:
  526.  move.l Intuition_Base,a6
  527.  move.l Window_Handler,a0
  528.  lea    Menu_Structure,a1
  529.  jsr    SetMenuStrip(a6)
  530.  rts
  531.  
  532. CLRMenu:
  533.  move.l Intuition_Base,a6
  534.  move.l Window_Handler,a0
  535.  jsr    ClearMenuStrip(a6) 
  536.  rts
  537.  
  538. MReset:                     ;clears check marked menus
  539.  move.l #10,d2              ;column 1 and 2 have 11 items
  540.  move   #0,COLUMN1_FLAGS
  541.  lea    menu11,a5
  542.  lea    menu21,a6
  543.  adda.l #12,a5
  544.  adda.l #12,a6
  545. Mclear:               ;in this loop CHECKED is cleared
  546.  bclr   #8,(a5)
  547.  bclr   #8,(a6)
  548.  adda.l #34,a5
  549.  adda.l #34,a6
  550.  dbra   d2,Mclear
  551.  move   #0,COLUMN3_FLAGS
  552.  lea    menu31,a5
  553.  adda.l #12,a5      ;in column 3 'NLQ' and '1/8 inch ...' are cleared
  554.  bclr   #8,(a5)
  555.  adda.l #102,a5
  556.  bclr   #8,(a5)
  557.  bra    GoOn
  558.  
  559. MInitialize:               ;clears some menu items in the first column
  560.  move.l #6,d2               ;clear 7 items
  561.  andi   #%1111111110000000,COLUMN1_FLAGS  ;item number 0,1,..,8
  562.  lea    menu11,a5
  563.  adda.l #12,a5
  564. MIclear:          ;this loop clears the CHECKED bits
  565.  bclr   #8,(a5)
  566.  adda.l #34,a5
  567.  dbra   d2,MIclear
  568.  move   #0,COLUMN3_FLAGS
  569.  lea    menu31,a5          ;also clear the 'NLQ' and '1/8 inch...'
  570.  adda.l #12,a5
  571.  bclr   #8,(a5)
  572.  adda.l #102,a5
  573.  bclr   #8,(a5)
  574.  bra    GoOn
  575.  
  576. SI:                           ;prints text at specified position.
  577.  move.l Intuition_Base,a6
  578.  move.l Window_Handler,a0
  579.  move.l 50(a0),a0
  580.  jsr    PrintIText(a6)
  581.  rts
  582.  
  583. Find_Event:
  584.  move.l Event,Event2
  585.  move.l ExecBase,a6
  586.  move.l Window_Handler,a0
  587.  move.l 86(a0),a0
  588.  jsr    WaitPort(a6)
  589.  move.l ExecBase,a6         ;event happened
  590.  move.l Window_Handler,a0
  591.  move.l 86(a0),a0
  592.  jsr    GetMsg(a6)      ;get the event
  593.  move.l d0,Event      ;save it
  594.  rts
  595.  
  596. Reply:
  597.  move.l ExecBase,a6
  598.  move.l Event,a1
  599.  jsr    ReplyMsg(a6)
  600.  rts
  601.  
  602. PRT_FAILED:                ;handles printer open failers
  603.  jsr    No_Menu_Allowed     ;restore menus
  604.  move.l Intuition_Base,a6
  605.  move.l ScreenHd,a0
  606.  jsr    DisplayBeep(a6)   ;flash the screen
  607.  move.l #PRT_F,bodyt
  608.  move.l #Canceling,leftt
  609.  jsr    Requester         ;inform that printer could not be opened
  610.  bra    ProcessNext
  611.  
  612. NO_FILE:                  ;handles file open failers
  613.  jsr    ClosePrinter
  614.  move.l Intuition_Base,a6
  615.  move.l ScreenHd,a0
  616.  jsr    DisplayBeep(a6)
  617.  move.l #NO_F,bodyt
  618.  move.l #Canceling,leftt
  619.  jsr    Requester        ;inform that file could not be opened
  620.  bra    loop
  621.  
  622.  
  623. OpenPrinter:
  624.  move.l DOS_Base,a6
  625.  lea    PRT_Name,a1
  626.  move.l #1006,d0
  627.  move.l a1,d1
  628.  move.l d0,d2
  629.  jsr    Open(a6)
  630.  rts
  631.  
  632. ClosePrinter:
  633.  move.l DOS_Base,a6
  634.  move.l PRT_Handler,d1
  635.  jsr    Close(a6)
  636.  rts
  637.  
  638. Prompting:         ;writes message text,like SI routine but at fixed pos.
  639.  move.l #12,d0              ;X pos.
  640.  move.l #11,d1              ;Y pos.
  641.  move.l Intuition_Base,a6
  642.  move.l Window_Handler,a0
  643.  move.l 50(a0),a0
  644.  jsr    PrintIText(a6)
  645.  rts
  646.  
  647. ProcessNext:      ;process the next menu while holding down the right mouse
  648.  tst    NextMSel     ;is there another menu to process?
  649.  bne    HasNext       ;yes!
  650.  bra    clearp
  651. HasNext:
  652.  move   NextM,d7
  653.  move   #0,NextMSel
  654.  bra    Real_Selection
  655.  
  656. Requester:
  657.  move.l Window_Handler,a0
  658.  lea    btext,a1
  659.  lea    ltext,a2
  660.  lea    rtext,a3
  661.  move.l #0,d0
  662.  move.l #0,d1
  663.  move.l #300,d2
  664.  move.l #60,d3
  665.  move.l Intuition_Base,a6
  666.  move.l #Canceling,rightt
  667.  jsr    AutoRequest(a6)
  668.  rts
  669.  
  670. UpDate:             ;update the start and end column
  671.  lea    BufferE,a1
  672.  clr.l  d0
  673.  move   Number,d0
  674.  beq    Zero         ;no entry in the gadget!
  675.  sub    #1,d0
  676.  jsr    B2A         ;convert Binary to Decimal
  677.  clr.l  d2
  678.  move   Number,d2
  679.  sub    #1,d2
  680.  lea    Buffer,a1
  681.  move.l #-1,d0
  682. StF:
  683.  add.l  #1,d0
  684.  cmpi.b #" ",(a1)+     ;spaces at the start of the text?
  685.  dbne   d2,StF
  686.  lea    BufferS,a1
  687.  move.l d0,Spaces     ;number of spaces
  688.  jsr    B2A
  689.  lea    BufS,a1       ;write start column number
  690.  move.l #180,d0
  691.  move.l #56,d1
  692.  jsr    SI
  693.  lea    BufE,a1      ;write end column number
  694.  move.l #305,d0
  695.  move.l #56,d1
  696.  jsr    SI
  697.  rts
  698.  
  699. Zero:                 ;no entry in gadget,print '???'
  700.  lea    Unknown,a1
  701.  move.l #180,d0
  702.  move.l #56,d1
  703.  jsr    SI
  704.  lea    UnKnown,a1
  705.  move.l #305,d0
  706.  move.l #56,d1
  707.  jsr    SI
  708.  rts
  709.  
  710. B2A:            ;this routine converts binary to ASCII and stores them 
  711.                 ;in string starting with a1
  712.  move.l #16,d2     ;must use 16 bit shifts!
  713.  divu   #100,d0    ;divide by 100,the quotient is the 100th number
  714.  move   d0,d1
  715.  add    #48,d1     ;in ASCII 0 begins at the 48th char
  716.  move.b d1,(a1)+   ;store it as a char
  717.  lsr.l  d2,d0      ;shift the d0 to have the remainder in low bits
  718.  divu   #10,d0     ;divide by 10
  719.  move   d0,d1
  720.  add    #48,d1
  721.  move.b d1,(a1)+
  722.  lsr.l  d2,d0
  723.  cmp    #10,d0
  724.  bne    add48
  725.  add    #1,d0
  726.  add.b  #1,$-1(a1)
  727. add48:
  728.  add    #48,d0
  729.  move.b d0,(a1)+
  730.  move.b #0,(a0)   ;write NULL to end the string
  731.  rts
  732.  
  733. End_Requested:          ;user clicked on the close gadget ,verify the quit
  734.  move.l #endbodyt,bodyt
  735.  move.l #Ofcourse,leftt
  736.  move.l #Canceling,rightt
  737.  jsr    requester
  738.  tst.l  d0          ;left or right choice?
  739.  beq    loop         ;it was the right one (Cancel)
  740.  jsr    Reply
  741.  move.l #0,DOSResult
  742. Clear_Menu:             ;it was the left one ,we must close system resources
  743.  move.l Intuition_Base,a6
  744.  move.l Window_Handler,a0
  745.  jsr    ClearMenuStrip(a6)
  746.  
  747. Close_Big_Window:
  748.  move.l Intuition_Base,a6
  749.  move.l Window_Handler,a0
  750.  jsr    CloseWindow(a6)
  751.  
  752. Close_DOS:
  753.  move.l ExecBase,a6
  754.  move.l DOS_Base,a1
  755.  jsr    CloseLib(a6)
  756.  
  757. Close_Intuition:
  758.  move.l ExecBase,a6
  759.  move.l Intuition_Base,a1
  760.  jsr    CloseLib(a6)
  761.  move.l DOSResult,d0
  762.  rts                  ;end of the program!
  763.  
  764. DECLARATIONS:
  765.  
  766. Libraries:
  767. DOS_Name:             dc.b "dos.library",0
  768. Intuition_Name:       dc.b "intuition.library",0
  769. DOS_Base:             dc.l 0
  770. Intuition_Base:       dc.l 0
  771. PRT:
  772. PRT_Name:             dc.b "PRT:",0,0
  773. PRT_Handler:          dc.l 0
  774. FontName:             dc.l FontStr
  775.                       dc.l 524288
  776. FontStr:              dc.b "topaz.font",0,0
  777. Window:
  778. Window_Handler:       dc.l 0
  779. Window_Name:          dc.b "Printer Controller",0,0
  780. Small_Window_Handler: dc.l 0
  781. Small_Window_Name:    dc.b "PC",0,0
  782. FileHd:               dc.l 0
  783. ReadBuffer:           blk.b 512
  784. Buffer:               blk.b 136,0
  785. UnDo:                 blk.b 136,0
  786. Buffer4:              blk.b 4,0
  787. Canceling:            dc.b "Cancel",0,0
  788. PRT_F:                dc.b " Can NOT Open Printer!",0,0
  789. NO_F:                 dc.b " Can NOT Open File!",0
  790. endbodyt:             dc.b " Realy Want to Quit?",0,0
  791. Ofcourse:             dc.b "Ofcourse!",0
  792. Event:                dc.l 0
  793. Event2:               dc.l 0
  794. DOSResult:            dc.l 0
  795. flag:                 dc.w 0
  796. charset:              dc.w 0
  797. last:                 dc.w 0
  798. Spaces:               dc.l 0
  799. UnderFlag:            dc.w 0
  800. NextM:                dc.w 0
  801. NextMSel:             dc.w 0
  802. SPC:                  blk.b 132,32
  803. COLUMN1_FLAGS:        dc.w 0
  804. COLUMN3_FLAGS:        dc.w 0
  805.  
  806. Window_Parameters:
  807.  dc.w 0,0,630,80
  808.  dc.b 0,1
  809.  dc.l $360
  810.  dc.l $100e
  811.  dc.l GADGET_DEF
  812.  dc.l 0
  813.  dc.l Window_Name
  814. ScreenHd:
  815.  dc.l 0
  816.  dc.l 0
  817.  dc.w 630,50,640,512
  818.  dc.w 1
  819.  
  820. Small_Window_Parameters:
  821.  dc.w 290,25,43,30
  822.  dc.b 0,1
  823.  dc.l $40
  824.  dc.l $1002
  825.  dc.l GADGET2_DEF
  826.  dc.l 0
  827.  dc.l Small_Window_Name
  828. ScreenHd2:
  829.  dc.l 0
  830.  dc.l 0
  831.  dc.w 630,50,640,512
  832.  dc.w 1
  833.  
  834. REQUEST:
  835. btext:
  836.  dc.b 2,1,0,0 ;the last zero is a pad 
  837.  dc.w 10,10
  838.  dc.l FontName
  839. bodyt:
  840.  dc.l 0,0
  841.  
  842. ltext:
  843.  dc.b 2,1,0,0  ;the last zero is a pad
  844.  dc.w 5,3
  845.  dc.l FontName
  846. leftt:
  847.  dc.l 0,0
  848.  
  849. rtext:
  850.  dc.b 2,1,0,0
  851.  dc.w 5,3
  852.  dc.l FontName
  853. rightt:
  854.  dc.l 0,0
  855.  
  856. GADGET:
  857. GADGET_DEF:
  858.  dc.l GADOK
  859.  dc.w 10,40,610,9
  860.  dc.w 0
  861.  dc.w 3
  862.  dc.w 4
  863.  dc.l BORDER_DEF
  864.  dc.l 0,0,0
  865.  dc.l STR_INFO
  866.  dc.w 2
  867.  dc.l 0
  868.  
  869. GADGET2_DEF:
  870.  dc.l 0
  871.  dc.w 5,12,35,15
  872.  dc.w 5
  873.  dc.w 3
  874.  dc.w 1
  875.  dc.l image22
  876.  dc.l 0,0,0,0
  877.  dc.w 1
  878.  dc.l 0
  879.  
  880. BORDER_DEF:
  881.  dc.w 0,0
  882.  dc.b 3,0,0,5
  883.  dc.l CoOrdination
  884.  dc.l Border_Def2
  885.  
  886. CoOrdination:
  887.  dc.w -2,-2,610,-2,610,9,-2,9,-2,-2
  888.  
  889. Border_Def2:
  890.  dc.w 0,0
  891.  dc.b 3,0,0,5
  892.  dc.l CoOrdination2
  893.  dc.l 0
  894.  
  895. CoOrdination2:
  896.  dc.w -4,-3,612,-3,612,10,-4,10,-4,-3
  897.  
  898. STR_INFO:
  899.  dc.l Buffer
  900.  dc.l UnDo
  901.  dc.w 0
  902.  dc.w 133
  903.  dc.w 0,0
  904. Number:
  905.  dc.w 0,0,0,0
  906.  dc.l 0,0
  907.  dc.l 0
  908.  
  909. GADOK:
  910.  dc.l GADNO
  911.  dc.w 40,59,32,13
  912.  dc.w 5
  913.  dc.w 3
  914.  dc.w 1
  915.  dc.l image1
  916.  dc.l 0,0,0,0
  917.  dc.w 1
  918.  dc.l 0
  919.  
  920. GADNO:
  921.  dc.l 0
  922.  dc.w 540,59,32,13
  923.  dc.w 5
  924.  dc.w 3
  925.  dc.w 1
  926.  dc.l image2
  927.  dc.l 0,0,0,0
  928.  dc.w 3
  929.  dc.l 0
  930.  
  931. image1:
  932.  dc.w 0,0,32,13
  933.  dc.w 1
  934.  dc.l imgdata1
  935.  dc.b 2,1
  936.  dc.l 0
  937.  
  938. imgdata1:
  939.  dc.l %00000000000000000000000000000000
  940.  dc.l %00001111111000000111100011100000
  941.  dc.l %00111000001110000011100011100000
  942.  dc.l %00111000001110000011100111000000
  943.  dc.l %00111000001110000011101110000000
  944.  dc.l %00111000001110000011111100000000
  945.  dc.l %00111000001110000011111100000000
  946.  dc.l %00111000001110000011100111000000
  947.  dc.l %00111000001110000011100011100000
  948.  dc.l %00111000001110000011100001110000
  949.  dc.l %00111000001110000011100001110000
  950.  dc.l %00001111111000000111100001110000
  951.  dc.l %00000000000000000000000000000000
  952.  
  953. image2:
  954.  dc.w 0,0,32,13
  955.  dc.w 1
  956.  dc.l imgdata2
  957.  dc.b 2,1
  958.  dc.l 0
  959.  
  960. imgdata2:
  961.  dc.l %00000000000000000000000000000000
  962.  dc.l %00111000000011100000111111100000
  963.  dc.l %00111100000011100011100000111000
  964.  dc.l %00111111000011100011100000111000
  965.  dc.l %00111011100011100011100000111000
  966.  dc.l %00111001110011100011100000111000
  967.  dc.l %00111000111011100011100000111000
  968.  dc.l %00111000011111100011100000111000
  969.  dc.l %00111000001111100011100000111000
  970.  dc.l %00111000000111100011100000111000
  971.  dc.l %00111000000011100011100000111000
  972.  dc.l %00111000000011100000111111100000
  973.  dc.l %00000000000000000000000000000000
  974.  
  975. image22:
  976.  dc.w 0,0,32,15
  977.  dc.w 1
  978.  dc.l imgd22
  979.  dc.b 2,1
  980.  dc.l 0
  981.  
  982. imgd22:
  983.  dc.l %00000000000000010000000000000000
  984.  dc.l %00000000000001111100000000000000
  985.  dc.l %00000000000011010110000000000000
  986.  dc.l %00000000000110010011000000000000
  987.  dc.l %00011000000000010000000000011000
  988.  dc.l %00110000000000010000000000001100
  989.  dc.l %01100000000000111000000000000110
  990.  dc.l %11111111111111111111111111111111
  991.  dc.l %01100000000000111000000000000110
  992.  dc.l %00110000000000010000000000001100
  993.  dc.l %00011000000000010000000000011000
  994.  dc.l %00000000000110010011000000000000
  995.  dc.l %00000000000011010110000000000000
  996.  dc.l %00000000000001111100000000000000
  997.  dc.l %00000000000000010000000000000000
  998.  
  999.  
  1000. Border1:
  1001.  dc.w 0,0
  1002.  dc.b 3,0,0,5
  1003.  dc.l CoOrd1
  1004.  dc.l Border2
  1005. CoOrd1:
  1006.  dc.w -2,0,25,0,25,9,-2,9,-2,0
  1007.  
  1008. Border2:
  1009.  dc.w 125,0
  1010.  dc.b 3,0,0,5
  1011.  dc.l CoOrd2
  1012.  dc.l Border3
  1013. CoOrd2:
  1014.  dc.w -2,0,25,0,25,9,-2,9,-2,0
  1015.  
  1016. Border3:
  1017.  dc.w -170,-45
  1018.  dc.b 3,0,0,5
  1019.  dc.l CoOrd3
  1020.  dc.l 0
  1021. CoOrd3:
  1022.  dc.w 0,0,210,0,210,9,0,9,0,0
  1023.  
  1024. LPROMPT:
  1025.  dc.b 1,2,1,0 ;the last zero is a pad
  1026.  dc.w 10,10
  1027.  dc.l FontName,textl,0
  1028. textl:           dc.b " Enter Line:              ",0,0
  1029. FPROMPT:
  1030.  dc.b 1,2,1,0
  1031.  dc.w 10,10
  1032.  dc.l FontName,textf,0
  1033. textf:           dc.b " Enter File Path and Name:",0,0
  1034. Menu_Bars:
  1035.  dc.b 1,2,1,0
  1036.  dc.w 10,10
  1037.  dc.l FontName,textn,0
  1038. textn:           dc.b " Choose From Menu Bars!   ",0,0
  1039. Intro:
  1040.  dc.b 1,2,1,0
  1041.  dc.w 10,10
  1042.  dc.l FontName,texti,0
  1043. texti:           dc.b " By Kamran Karimi         ",0,0
  1044. Busy:
  1045.  dc.b 1,2,1,0
  1046.  dc.w 10,10
  1047.  dc.l FontName,textb,0
  1048. textb:           dc.b " Please Wait...           ",0,0
  1049. BufE:
  1050.  dc.b 1,2,1,0
  1051.  dc.w 10,10
  1052.  dc.l FontName,BufferE,0
  1053. BufferE:         blk.b 4,0
  1054. BufS:
  1055.  dc.b 1,2,1,0  ;the last zero is a pad
  1056.  dc.w 10,10
  1057.  dc.l FontName,BufferS,0
  1058. BufferS:         blk.b 4,0
  1059. Stext:
  1060.  dc.b 1,0,1,0
  1061.  dc.w 10,10
  1062.  dc.l FontName,startt,0
  1063. startt:          dc.b "Start Column",0,0
  1064. Etext:
  1065.  dc.b 1,0,1,0
  1066.  dc.w 10,10
  1067.  dc.l FontName,Endt,0
  1068. Endt:            dc.b "End Column",0,0
  1069.  
  1070. UnKnown:
  1071.  dc.b 1,2,1,0
  1072.  dc.w 10,10
  1073.  dc.l FontName,UnKnow,0
  1074. UnKnow:            dc.b "???",0
  1075.  
  1076. Menu:
  1077. Title1:  dc.b "Style",0
  1078. Title2:  dc.b "Character Set",0
  1079. Title3:  dc.b "Control",0
  1080. Title4:  dc.b "Print",0
  1081. Title5:  dc.b "Stand By",0
  1082.  ds.w 0
  1083.   
  1084. MI11:    dc.b 0,1,0,0
  1085.  dc.w 1,1
  1086.  dc.l FontName,tex11,0
  1087. tex11: dc.b "  Italics",0
  1088. MI12:    dc.b 0,1,0
  1089.  ds.w 0      
  1090.  dc.w 1,1
  1091.  dc.l FontName,tex12,0
  1092. tex12: dc.b "  Underline",0
  1093. MI13:    dc.b 0,1,0,0
  1094.  dc.w 1,1
  1095.  dc.l FontName,tex13,0
  1096. tex13: dc.b "  Bold",0,0
  1097. MI14:    dc.b 0,1,0,0
  1098.  dc.w 1,1
  1099.  dc.l FontName,tex14,0
  1100. tex14: dc.b "  Enlarged",0,0
  1101. MI15:    dc.b 0,1,0,0
  1102.  dc.w 1,1
  1103.  dc.l FontName,tex15,0
  1104. tex15: dc.b "  Condensed",0
  1105. MI16:    dc.b 0,1,0,0
  1106.  dc.w 1,1
  1107.  dc.l FontName,tex16,0
  1108. tex16: dc.b "  Proportional",0,0
  1109. MI17:    dc.b 0,1,0,0
  1110.  dc.w 1,1
  1111.  dc.l FontName,tex17,0
  1112. tex17: dc.b "  Elite",0
  1113. MI18:    dc.b 0,1,0,0
  1114.  dc.w 1,1
  1115.  dc.l FontName,tex18,0
  1116. tex18: dc.b "  Doublestrike",0,0
  1117. MI19:    dc.b 0,1,0,0
  1118.  dc.w 1,1
  1119.  dc.l FontName,tex19,0
  1120. tex19: dc.b "  Superscript",0
  1121. MI110:   dc.b 0,1,0,0
  1122.  dc.w 1,1
  1123.  dc.l FontName,tex110,0
  1124. tex110: dc.b "  Subscript",0
  1125. MI111:   dc.b 0,1,0,0
  1126.  dc.w 1,1
  1127.  dc.l FontName,tex111,0
  1128. tex111: dc.b "  Shadow",0,0
  1129. MI21:    dc.b 0,1,0,0
  1130.  dc.w 1,1
  1131.  dc.l FontName,tex21,0
  1132. tex21: dc.b "  U.S",0
  1133. MI22:    dc.b 0,1,0,0
  1134.  dc.w 1,1
  1135.  dc.l FontName,tex22,0
  1136. tex22: dc.b "  German",0,0
  1137. MI23:    dc.b 0,1,0,0
  1138.  dc.w 1,1
  1139.  dc.l FontName,tex23,0
  1140. tex23: dc.b "  British",0
  1141. MI24:    dc.b 0,1,0,0
  1142.  dc.w 1,1
  1143.  dc.l FontName,tex24,0
  1144. tex24: dc.b "  French",0,0
  1145. MI25:    dc.b 0,1,0,0
  1146.  dc.w 1,1
  1147.  dc.l FontName,tex25,0
  1148. tex25: dc.b "  Swedish",0
  1149. MI26:    dc.b 0,1,0,0
  1150.  dc.w 1,1
  1151.  dc.l FontName,tex26,0
  1152. tex26: dc.b "  Italian",0
  1153. MI27:    dc.b 0,1,0,0
  1154.  dc.w 1,1
  1155.  dc.l FontName,tex27,0
  1156. tex27: dc.b "  Spanish",0
  1157. MI28:    dc.b 0,1,0,0
  1158.  dc.w 1,1
  1159.  dc.l FontName,tex28,0
  1160. tex28: dc.b "  Norwegian",0
  1161. MI29:    dc.b 0,1,0,0
  1162.  dc.w 1,1
  1163.  dc.l FontName,tex29,0
  1164. tex29: dc.b "  Danish I",0,0
  1165. MI210:   dc.b 0,1,0
  1166.  dc.w 1,1
  1167.  dc.l FontName,tex210,0
  1168. tex210: dc.b "  Danish II",0
  1169. MI211:   dc.b 0,1,0,0
  1170.  dc.w 1,1
  1171.  dc.l FontName,tex211,0
  1172. tex211: dc.b "  Japanese",0,0
  1173. MI31:    dc.b 0,1,0,0
  1174.  dc.w 1,1
  1175.  dc.l FontName,tex31,0
  1176. tex31: dc.b "  NLQ",0
  1177. MI32:    dc.b 0,1,0,0
  1178.  dc.w 1,1
  1179.  dc.l FontName,tex32,0
  1180. tex32: dc.b "  Linefeed",0,0
  1181. MI33:    dc.b 0,1,0,0
  1182.  dc.w 1,1
  1183.  dc.l FontName,tex33,0
  1184. tex33: dc.b "  Formfeed",0,0
  1185. MI34:    dc.b 0,1,0,0
  1186.  dc.w 1,1
  1187.  dc.l FontName,tex34,0
  1188. tex34: dc.b "  1/8 inch Linespacing",0,0
  1189. MI35:    dc.b 0,1,0,0
  1190.  dc.w 1,1
  1191.  dc.l FontName,tex35,0
  1192. tex35: dc.b "  Reverse Linefeed",0,0
  1193. MI36:    dc.b 0,1,0,0
  1194.  dc.w 1,1
  1195.  dc.l FontName,tex36,0
  1196. tex36: dc.b "  Initialize",0,0
  1197. MI37:    dc.b 0,1,0,0
  1198.  dc.w 1,1
  1199.  dc.l Fontname,tex37,0
  1200. tex37: dc.b "  Reset",0
  1201.        
  1202. MI41:    dc.b 0,1,0,0
  1203.  dc.w 1,1
  1204.  dc.l Fontname,tex41,0
  1205. tex41: dc.b "   a File",0
  1206. MI42:    dc.b 0,1,0,0
  1207.  dc.w 1,1
  1208.  dc.l FontName,tex42,0
  1209. tex42: dc.b "   a Line",0
  1210.        
  1211. MI51:   dc.b 0,1,0,0
  1212.  dc.w 1,1
  1213.  dc.l FontName,tex51,0
  1214. tex51: dc.b "  Please ",0
  1215.        
  1216. Menu_Structure:
  1217. menu1:
  1218.  dc.l menu2
  1219.  dc.w 15,0
  1220.  dc.w 55,10
  1221.  dc.w 1
  1222.  dc.l Title1
  1223.  dc.l menu11
  1224.  dc.w 0,0,0,0
  1225.  
  1226. menu2:
  1227.  dc.l menu3
  1228.  dc.w 95,0
  1229.  dc.w 135,10
  1230.  dc.w 1
  1231.  dc.l Title2
  1232.  dc.l menu21
  1233.  dc.w 0,0,0,0
  1234.  
  1235. menu3:
  1236.  dc.l menu4
  1237.  dc.w 250,0
  1238.  dc.w 75,10
  1239.  dc.w 1
  1240.  dc.l Title3
  1241.  dc.l menu31
  1242.  dc.w 0,0,0,0
  1243.  
  1244. menu4:
  1245.  dc.l menu5
  1246.  dc.w 350,0
  1247.  dc.w 55,10
  1248.  dc.w 1
  1249.  dc.l Title4
  1250.  dc.l menu41
  1251.  dc.w 0,0,0,0
  1252.  
  1253. menu5:
  1254.  dc.l 0
  1255.  dc.w 420,0
  1256.  dc.w 85,10
  1257.  dc.w 1
  1258.  dc.l Title5
  1259.  dc.l menu51
  1260.  dc.w 0,0,0,0
  1261.  
  1262. menu11:
  1263.  dc.l menu12
  1264.  dc.w 0,0,120,10
  1265.  dc.w $9b
  1266.  dc.l 0,MI11,0
  1267.  dc.b 0,0       ;the last zero is pad
  1268.  dc.l 0
  1269.  dc.w 0
  1270. menu12:
  1271.  dc.l menu13
  1272.  dc.w 0,12,120,10
  1273.  dc.w $9b
  1274.  dc.l 0,MI12,0
  1275.  dc.b 0,0  ;the last zero is pad   
  1276.  dc.l 0
  1277.  dc.w 0
  1278. menu13:
  1279.  dc.l menu14
  1280.  dc.w 0,24,120,10
  1281.  dc.w $9b
  1282.  dc.l 0,MI13,0
  1283.  dc.b 0,0   
  1284.  dc.l 0
  1285.  dc.w 0
  1286. menu14:
  1287.  dc.l menu15
  1288.  dc.w 0,36,120,10
  1289.  dc.w $9b
  1290.  dc.l 0,MI14,0
  1291.  dc.b 0,0   
  1292.  dc.l 0
  1293.  dc.w 0
  1294. menu15:
  1295.  dc.l menu16
  1296.  dc.w 0,48,120,10
  1297.  dc.w $9b
  1298.  dc.l 0,MI15,0
  1299.  dc.b 0,0   
  1300.  dc.l 0
  1301.  dc.w 0
  1302. menu16:
  1303.  dc.l menu17
  1304.  dc.w 0,60,120,10
  1305.  dc.w $9b
  1306.  dc.l 0,MI16,0
  1307.  dc.b 0,0   
  1308.  dc.l 0
  1309.  dc.w 0
  1310. menu17:
  1311.  dc.l menu18
  1312.  dc.w 0,72,120,10
  1313.  dc.w $9b
  1314.  dc.l 0,MI17,0
  1315.  dc.b 0,0   
  1316.  dc.l 0
  1317.  dc.w 0
  1318. menu18:
  1319.  dc.l menu19
  1320.  dc.w 0,84,120,10
  1321.  dc.w $9b
  1322.  dc.l 0,MI18,0
  1323.  dc.b 0,0   
  1324.  dc.l 0
  1325.  dc.w 0
  1326. menu19:
  1327.  dc.l menu110
  1328.  dc.w 0,96,120,10
  1329.  dc.w $9b
  1330.  dc.l %01000000000,MI19,0
  1331.  dc.b 0,0   
  1332.  dc.l 0
  1333.  dc.w 0
  1334. menu110:
  1335.  dc.l menu111
  1336.  dc.w 0,108,120,10
  1337.  dc.w $9b
  1338.  dc.l %00100000000,MI110,0
  1339.  dc.b 0,0   
  1340.  dc.l 0
  1341.  dc.w 0
  1342. menu111:
  1343.  dc.l 0
  1344.  dc.w 0,120,120,10
  1345.  dc.w $9b
  1346.  dc.l 0,MI111,0
  1347.  dc.b 0,0   
  1348.  dc.l 0
  1349.  dc.w 0
  1350.  
  1351. menu21:
  1352.  dc.l menu22
  1353.  dc.w 0,0,130,10
  1354.  dc.w $9b
  1355.  dc.l %11111111110,MI21,0
  1356.  dc.b 0,0   
  1357.  dc.l 0
  1358.  dc.w 0
  1359. menu22:
  1360.  dc.l menu23
  1361.  dc.w 0,12,130,10
  1362.  dc.w $9b
  1363.  dc.l %11111111101,MI22,0
  1364.  dc.b 0,0   
  1365.  dc.l 0
  1366.  dc.w 0
  1367. menu23:
  1368.  dc.l menu24
  1369.  dc.w 0,24,130,10
  1370.  dc.w $9b
  1371.  dc.l %11111111011,MI23,0
  1372.  dc.b 0,0   
  1373.  dc.l 0
  1374.  dc.w 0
  1375. menu24:
  1376.  dc.l menu25
  1377.  dc.w 0,36,130,10
  1378.  dc.w $9b
  1379.  dc.l %11111110111,MI24,0
  1380.  dc.b 0,0   
  1381.  dc.l 0
  1382.  dc.w 0
  1383. menu25:
  1384.  dc.l menu26
  1385.  dc.w 0,48,130,10
  1386.  dc.w $9b
  1387.  dc.l %11111101111,MI25,0
  1388.  dc.b 0,0   
  1389.  dc.l 0
  1390.  dc.w 0
  1391. menu26:
  1392.  dc.l menu27
  1393.  dc.w 0,60,130,10
  1394.  dc.w $9b
  1395.  dc.l %11111011111,MI26,0
  1396.  dc.b 0,0   
  1397.  dc.l 0
  1398.  dc.w 0
  1399. menu27:
  1400.  dc.l menu28
  1401.  dc.w 0,72,130,10
  1402.  dc.w $9b
  1403.  dc.l %11110111111,MI27,0
  1404.  dc.b 0,0    
  1405.  dc.l 0
  1406.  dc.w 0
  1407. menu28:
  1408.  dc.l menu29
  1409.  dc.w 0,84,130,10
  1410.  dc.w $9b
  1411.  dc.l %11101111111,MI28,0
  1412.  dc.b 0,0   
  1413.  dc.l 0
  1414.  dc.w 0
  1415. menu29:
  1416.  dc.l menu210
  1417.  dc.w 0,96,130,10
  1418.  dc.w $9b
  1419.  dc.l %11011111111,MI29,0
  1420.  dc.b 0,0   
  1421.  dc.l 0
  1422.  dc.w 0
  1423. menu210:
  1424.  dc.l menu211
  1425.  dc.w 0,108,130,10
  1426.  dc.w $9b
  1427.  dc.l %10111111111,MI210,0
  1428.  dc.b 0,0   
  1429.  dc.l 0
  1430.  dc.w 0
  1431. menu211:
  1432.  dc.l 0
  1433.  dc.w 0,120,130,10
  1434.  dc.w $9b
  1435.  dc.l %01111111111,MI211,0
  1436.  dc.b 0,0   
  1437.  dc.l 0
  1438.  dc.w 0
  1439.  
  1440. menu31:
  1441.  dc.l menu32
  1442.  dc.w 0,0,185,10
  1443.  dc.w $9b
  1444.  dc.l 0,MI31,0
  1445.  dc.b 0,0   
  1446.  dc.l 0
  1447.  dc.w 0
  1448. menu32:
  1449.  dc.l menu33
  1450.  dc.w 0,12,185,10
  1451.  dc.w $9a
  1452.  dc.l 0,MI32,0
  1453.  dc.b 0,0   
  1454.  dc.l 0
  1455.  dc.w 0
  1456. menu33:
  1457.  dc.l menu34
  1458.  dc.w 0,24,185,10
  1459.  dc.w $9a
  1460.  dc.l 0,MI33,0
  1461.  dc.b 0,0   
  1462.  dc.l 0
  1463.  dc.w 0
  1464. menu34:
  1465.  dc.l menu35
  1466.  dc.w 0,36,185,10
  1467.  dc.w $9b
  1468.  dc.l 0,MI34,0
  1469.  dc.b 0,0   
  1470.  dc.l 0
  1471.  dc.w 0
  1472. menu35:
  1473.  dc.l menu36
  1474.  dc.w 0,48,185,10
  1475.  dc.w $9a
  1476.  dc.l 0,MI35,0
  1477.  dc.b 0,0   
  1478.  dc.l 0
  1479.  dc.w 0
  1480. menu36:
  1481.  dc.l menu37
  1482.  dc.w 0,60,185,10
  1483.  dc.w $9a
  1484.  dc.l 0,MI36,0
  1485.  dc.b 0,0   
  1486.  dc.l 0
  1487.  dc.w 0
  1488. menu37:
  1489.  dc.l 0
  1490.  dc.w 0,72,185,10
  1491.  dc.w $9a
  1492.  dc.l 0,MI37,0
  1493.  dc.b 0,0   
  1494.  dc.l 0
  1495.  dc.w 0
  1496.  
  1497. menu41:
  1498.  dc.l menu42
  1499.  dc.w 0,0,80,10
  1500.  dc.w $9a
  1501.  dc.l 0,MI41,0
  1502.  dc.b 0,0   
  1503.  dc.l 0
  1504.  dc.w 0
  1505. menu42:
  1506.  dc.l 0
  1507.  dc.w 0,12,80,10
  1508.  dc.w $9a
  1509.  dc.l 0,MI42,0
  1510.  dc.b 0,0   
  1511.  dc.l 0
  1512.  dc.w 0
  1513.  
  1514. menu51:
  1515.  dc.l 0
  1516.  dc.w 0,0,80,10
  1517.  dc.w $9a
  1518.  dc.l 0,MI51,0
  1519.  dc.b 0,0   
  1520.  dc.l 0
  1521.  dc.w 0
  1522.  
  1523. Styles:
  1524.  dc.b 27,91,51,109,0,0,27,91,50,51,109,0,27,91,52,109,0,0,27,91,50,52,109,0
  1525.  dc.b 27,91,49,109,0,0,27,91,50,50,109,0,27,91,54,119,0,0,27,91,53,119,0,0
  1526.  dc.b 27,91,52,87,0,0,27,91,51,119,0,0
  1527.  dc.b 27,91,50,112,0,0,27,91,49,112,0,0,27,91,50,119,0,0,27,91,49,119,0,0
  1528.  dc.b 27,91,52,34,122,0,27,91,51,34,122,0,27,91,50,118,0,0,27,91,49,118,0,0
  1529.  dc.b 27,91,52,118,0,0,27,91,51,118,0,0,27,91,54,34,122,0,27,91,53,34,122,0
  1530.  
  1531. Characters:
  1532.  dc.b 27,40,66,0,0,0,27,40,75,0,0,0
  1533.  dc.b 27,40,65,0,0,0,27,40,82,0,0,0
  1534.  dc.b 27,40,72,0,0,0,27,40,89,0,0,0
  1535.  dc.b 27,40,90,0,0,0,27,40,54,0,0,0 
  1536.  dc.b 27,40,69,0,0,0
  1537.  dc.b 27,40,67,0,0,0,27,40,74,0,0,0
  1538.  
  1539. Controls:
  1540.  dc.b 27,91,50,34,122,0,27,91,49,34,122,0,27,68,0,0,0,0,27,68,0,0,0,0
  1541.  dc.b 12,0,0,0,0,0,12,0,0,0,0,0,27,91,48,122,0,0,27,91,49,122,0,0
  1542.  dc.b 27,77,0,0,0,0,27,77,0,0,0,0,27,35,49,0,0,0
  1543.  dc.b 27,35,49,0,0,0,27,99,0,0,0,0,27,99,0,0,0,0
  1544.  
  1545.  end
  1546.  
  1547.